<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <base href="#(basePath)"/>
    <title>付款管理 -等待付款完成的订单</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="static/layui/css/layui.css" media="all">
    <style type="text/css">
        .layui-form-label{width:100px;}
    </style>
</head>
<body>

<table class="layui-table">
    <colgroup>
        <col width="200">
        <col width="350">
        <col width="350">
        <col width="200">
    </colgroup>
    <thead>
    <tr>
        <th>制单时间</th>
        <th>收款人信息</th>
        <th>打款账户</th>
        <th>打款金额</th>
        <th>订单号</th>
    </tr>
    </thead>
    #for(item:orderList)
    <tbody>
    <tr>
        <td>#(item.createTime)</td>
        <td>#(item.accountName)-#(item.accountNo)</td>
        <td>#(item.outAccountName)-#(item.outAccountNo)</td>
        <td>#(item.amountShow)</td>
        <td>#(item.orderNo)</td>
    </tr>
    </tbody>
    #end
</table>

<div class="layui-form-item layui-hide">
    <input type="button" lay-submit lay-filter="layuiadmin-app-form-edit" id="layuiadmin-app-form-edit" value="付款完成">
</div>


<script src="static/layui/layui.js"></script>
<script>
    layui.config({
        base: '#(basePath)' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form'], function(){
        var $ = layui.$
            ,form = layui.form;
        //监听提交
        form.on('submit(layuiadmin-app-form-edit)', function(data){
           var field = '#(jsonList)';
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            //提交 Ajax 成功后，关闭当前弹层并重载表格
            $.ajax({
                url: layui.setter.base+"admin/pay/complant",
                type:"post",
                data: field,
                success: function(res){
                    if(res.code !== 0){
                        parent.layer.msg(res.msg, {icon: 2});
                    }else{
                        parent.layer.msg(res.msg, {icon: 1});
                        //parent.layui.$("#LAY_app_body > div.layui-show iframe").get()[0].contentWindow.layui.table.reload('LAY-web-list'); //重载表格
                        parent.layer.close(index); //再执行关闭
                    }
                },
                error: function(xhr){parent.layer.msg("出错了" + xhr);}
            });
        });
    })
</script>


</body>
</html>
